***                                                                                                                                                                                                                                                       
***                                                                                                                                                                                                                                                       
*** This Program already converted to Y2K                                                                                                                                                                                                                 
*** S&T Departement     on 29 April 1999 by Ben.Rahman                                                                                                                                                                                                    
***                                                                                                                                                                                                                                                       
***                                                                                                                                                                                                                                                       
set cent on                                                                                                                                                                                                                                               
   page=page+1                                                                                                                                                                                                                                            
   SET DEVI TO PRINT                                                                                                                                                                                                                                      
   STORE 0 TO TOTMED,TOTPHR,TOTALL                                                                                                                                                                                                                        
   a=year(date())                                                                                                                                                                                                                                         
   a=substr(str(a,4),3,2)                                                                                                                                                                                                                                 
   @  1,  2 SAY USERNM                                                                                                                                                                                                                                    
   @  1, 68 SAY  a+'/'+str(MONTH(DATE()),2)+'/'+NOFT                                                                                                                                                                                                      
   @  3,  2  SAY DATE()                                                                                                                                                                                                                                   
   @  3, 75 say str(page,1)                                                                                                                                                                                                                               
   @  4,  2  SAY TIME()                                                                                                                                                                                                                                   
   @  4, 59  SAY KDPAT                                                                                                                                                                                                                                    
   @  6, 11  SAY NMPAT                                                                                                                                                                                                                                    
   @  6, 40  SAY FNMPAT                                                                                                                                                                                                                                   
   @  6, 70  SAY MNMPAT                                                                                                                                                                                                                                   
   @  7, 14  SAY subs(dtoc(DOBPAT),1,2)                                                                                                                                                                                                                   
   @  7, 17  SAY subs(dtoc(DOBPAT),4,2)                                                                                                                                                                                                                   
   @  7, 20  SAY subs(dtoc(DOBPAT),7,4)                                                                                                                                                                                                                   
   @  7, 40  SAY NATIO                                                                                                                                                                                                                                    
   @  7, 70  SAY ISEX                                                                                                                                                                                                                                     
   BR=12                                                                                                                                                                                                                                                  
   SELE 2                                                                                                                                                                                                                                                 
   GO TOP                                                                                                                                                                                                                                                 
   DO WHILE .NOT. EOF()                                                                                                                                                                                                                                   
      KDSH=AREA_CODE+SUB_AREACO+PRO_CODE                                                                                                                                                                                                                  
      @ BR,2 SAY KDSH                                                                                                                                                                                                                                     
      @ BR,8 SAY SHRT_DESCR                                                                                                                                                                                                                               
      IF AREA_CODE<>'E'                                                                                                                                                                                                                                   
         @ BR,36 SAY DOC_CODE                                                                                                                                                                                                                             
         @ BR,44 SAY DOC_ALIAS                                                                                                                                                                                                                            
      ENDIF                                                                                                                                                                                                                                               
      @ BR,58 SAY PROC_X                                                                                                                                                                                                                                  
      @ BR,67 SAY PROC_PAY PICT '9,999,999'                                                                                                                                                                                                               
      TOTMED=TOTMED+PROC_PAY                                                                                                                                                                                                                              
      TOTALL=TOTALL+PROC_PAY                                                                                                                                                                                                                              
      IF BR>22                                                                                                                                                                                                                                            
         EJECT                                                                                                                                                                                                                                            
         page=page+1                                                                                                                                                                                                                                      
         @  1, 68 SAY  A+'/'+STR(MONTH(DATE()),2)+'/'+NOFT                                                                                                                                                                                                
         @  3,  2  SAY DATE()                                                                                                                                                                                                                             
         @  3,75 say str(page,1)                                                                                                                                                                                                                          
         @  4,  2  SAY TIME()                                                                                                                                                                                                                             
         @  4, 59  SAY KDPAT                                                                                                                                                                                                                              
         @  6, 11  SAY NMPAT                                                                                                                                                                                                                              
         @  6, 40  SAY FNMPAT                                                                                                                                                                                                                             
         @  6, 70  SAY MNMPAT                                                                                                                                                                                                                             
         @  7, 14  SAY subs(dtoc(DOBPAT),1,2)                                                                                                                                                                                                             
         @  7, 17  SAY subs(dtoc(DOBPAT),4,2)                                                                                                                                                                                                             
         @  7, 20  SAY subs(dtoc(DOBPAT),7,4)                                                                                                                                                                                                             
         @  7, 40  SAY NATIO                                                                                                                                                                                                                              
         @  7, 70  SAY ISEX                                                                                                                                                                                                                               
         BR=12                                                                                                                                                                                                                                            
      ENDIF                                                                                                                                                                                                                                               
      SKIP                                                                                                                                                                                                                                                
      BR=BR+1                                                                                                                                                                                                                                             
   ENDDO                                                                                                                                                                                                                                                  
   BR=29                                                                                                                                                                                                                                                  
   SELE 3                                                                                                                                                                                                                                                 
   f3='ph'+kdpat                                                                                                                                                                                                                                          
   use &dr&f3                                                                                                                                                                                                                                             
   GO TOP                                                                                                                                                                                                                                                 
   DO WHILE .NOT. EOF()                                                                                                                                                                                                                                   
      KDTEMP=PHAR_CODE                                                                                                                                                                                                                                    
      PAYTMP=PHAR_PAY                                                                                                                                                                                                                                     
      XTEM=PHAR_X                                                                                                                                                                                                                                         
      @ BR,2 SAY KDTEMP                                                                                                                                                                                                                                   
      @ BR,8 SAY RTRIM(PHAR_NAME)+'  '+RTRIM(PHAR_TYPE)+'  '+rtrim(PHAR_QANT)+'  '+PHAR_UNIT                                                                                                                                                              
      @ BR,49 SAY PHAR_X                                                                                                                                                                                                                                  
      @ BR,56 SAY SALE_PRICE                                                                                                                                                                                                                              
      @ BR,67 SAY PHAR_pay PICT '9,999,999'                                                                                                                                                                                                               
      IF SUBSTR(KDTEMP,2,1)='6' .OR. SUBS(KDTEMP,2,1)='7' .OR. SUBSTR(KDTEMP,2,1)='9'                                                                                                                                                                     
         F10='DISPOS'                                                                                                                                                                                                                                     
         SELE 10                                                                                                                                                                                                                                          
         USE &DR&F10 INDEX &DR&F10                                                                                                                                                                                                                        
         SEEK KDTEMP                                                                                                                                                                                                                                      
         IF REC_LOCK(0)                                                                                                                                                                                                                                   
            REPL ST_ACT_TOT WITH ST_ACT_TOT-XTEM                                                                                                                                                                                                          
            REPL ST_ACT_BUY WITH INT(ST_ACT_TOT/BUY_SELL_R)                                                                                                                                                                                               
            REPL ST_ACT_SEL WITH ST_ACT_TOT-(ST_ACT_BUY*BUY_SELL_R)                                                                                                                                                                                       
         ENDIF                                                                                                                                                                                                                                            
         UNLOCK                                                                                                                                                                                                                                           
      ELSE                                                                                                                                                                                                                                                
         F10='DRUGS'                                                                                                                                                                                                                                      
         SELE 10                                                                                                                                                                                                                                          
         USE &DR&F10 INDEX &DR&F10                                                                                                                                                                                                                        
         SEEK KDTEMP                                                                                                                                                                                                                                      
         IF REC_LOCK(0)                                                                                                                                                                                                                                   
            REPL ST_ACT_TOT WITH ST_ACT_TOT-XTEM                                                                                                                                                                                                          
            REPL ST_ACT_BUY WITH INT(ST_ACT_TOT/BUY_SELL_R)                                                                                                                                                                                               
            REPL ST_ACT_SEL WITH ST_ACT_TOT-(ST_ACT_BUY*BUY_SELL_R)                                                                                                                                                                                       
         ENDIF                                                                                                                                                                                                                                            
         UNLOCK                                                                                                                                                                                                                                           
      ENDIF                                                                                                                                                                                                                                               
      TOTPHR=TOTPHR+PAYTMP                                                                                                                                                                                                                                
      TOTALL=TOTALL+PAYTMP                                                                                                                                                                                                                                
      BR=BR+1                                                                                                                                                                                                                                             
      IF BR>42                                                                                                                                                                                                                                            
         EJECT                                                                                                                                                                                                                                            
         page=page+1                                                                                                                                                                                                                                      
         @  1,68 SAY  A+'/'+STR(MONTH(DATE()),2)+'/'+NOFT                                                                                                                                                                                                 
         @  3,2 SAY DATE()                                                                                                                                                                                                                                
         @  3,75 say str(page,1)                                                                                                                                                                                                                          
         @  4,2 SAY TIME()                                                                                                                                                                                                                                
         @  4,59 SAY KDPAT                                                                                                                                                                                                                                
         @  6,11 SAY NMPAT                                                                                                                                                                                                                                
         @  6,40 SAY FNMPAT                                                                                                                                                                                                                               
         @  6,70 SAY MNMPAT                                                                                                                                                                                                                               
         @  7,14 SAY subs(dtoc(DOBPAT),1,2)                                                                                                                                                                                                               
         @  7,17 SAY subs(dtoc(DOBPAT),4,2)                                                                                                                                                                                                               
         @  7,20 SAY subs(dtoc(DOBPAT),7,4)                                                                                                                                                                                                               
         @  7,40 SAY NATIO                                                                                                                                                                                                                                
         @  7,70 SAY ISEX                                                                                                                                                                                                                                 
         BR=29                                                                                                                                                                                                                                            
      ENDIF                                                                                                                                                                                                                                               
      SELE 3                                                                                                                                                                                                                                              
      SKIP                                                                                                                                                                                                                                                
   ENDDO                                                                                                                                                                                                                                                  
   @ 49,12 SAY TOTMED PICT '9,999,999'                                                                                                                                                                                                                    
   @ 49,40 SAY TOTPHR PICT '9,999,999'                                                                                                                                                                                                                    
   @ 49,65 SAY TOTALL PICT '9,999,999'                                                                                                                                                                                                                    
   DO CASE                                                                                                                                                                                                                                                
   CASE TOTALL=0 .AND. HEALTH                                                                                                                                                                                                                             
      @ 53,25 SAY "   A E A - T M S   F O R M   "                                                                                                                                                                                                         
      @ 58,4 SAY "The cost of this treatment is entirely borne by AEA-TMS Medical Plan"                                                                                                                                                                   
      @ 59,4 SAY "offered by A. E. A. International Clinic (Jakarta)"                                                                                                                                                                                     
      @ 64,9 SAY subs(dtoc(DATE()),1,2)                                                                                                                                                                                                                   
      @ 64,12 SAY subs(dtoc(DATE()),4,2)                                                                                                                                                                                                                  
      @ 64,15 SAY subs(dtoc(DATE()),7,4)                                                                                                                                                                                                                  
   CASE TOTALL=0 .AND. MDS                                                                                                                                                                                                                                
      @ 53,25 SAY "  TREATMENT, FREE OF CHARGE  "                                                                                                                                                                                                         
      @ 58,4 SAY "dear Medical Scheme Member, the cost of this treatment is entirely borne "                                                                                                                                                              
      @ 59,4 SAY "by A.E.A. International Clinic (Jakarta)"                                                                                                                                                                                               
      @ 64,9 SAY subs(dtoc(DATE()),1,2)                                                                                                                                                                                                                   
      @ 64,12 SAY subs(dtoc(DATE()),4,2)                                                                                                                                                                                                                  
      @ 64,15 SAY subs(dtoc(DATE()),7,4)                                                                                                                                                                                                                  
   CASE TOTALL=0 .AND. .NOT. HEALTH .AND. .NOT. MDS .AND. PILC=9                                                                                                                                                                                          
      @ 53,25 SAY " N O   C H A R G E   F O R M "                                                                                                                                                                                                         
      @ 58,4 SAY "The cost of this treatment is entirely borne by A.E.A. International Clinic"                                                                                                                                                            
      @ 59,4 say "(Jakarta)"                                                                                                                                                                                                                              
      @ 64,9 SAY subs(dtoc(DATE()),1,2)                                                                                                                                                                                                                   
      @ 64,12 SAY subs(dtoc(DATE()),4,2)                                                                                                                                                                                                                  
      @ 64,15 SAY subs(dtoc(DATE()),7,4)                                                                                                                                                                                                                  
   CASE TOTALL>0 .AND. (PILC=3 .or. pilc=5 .or. pilc=11)                                                                                                                                                                                                  
      @ 53, 25  SAY "P A Y M E N T   R E C E I P T"                                                                                                                                                                                                       
      @ 55,10 say rtrim(fnmpat)+' '+nmpat                                                                                                                                                                                                                 
      @ 56,58 SAY subs(dtoc(DATE()),1,2)                                                                                                                                                                                                                  
      @ 56,61 SAY subs(dtoc(DATE()),4,2)                                                                                                                                                                                                                  
      @ 56,64 SAY subs(dtoc(DATE()),7,4)                                                                                                                                                                                                                  
      @ 57,3 say "Paid, the sum of : "+AEACURR                                                                                                                                                                                                            
      @ 57,25 say totall pict '99,999,999'                                                                                                                                                                                                                
      @ 57,37 say 'by : '+paymode                                                                                                                                                                                                                         
      @ 64,9 SAY subs(dtoc(DATE()),1,2)                                                                                                                                                                                                                   
      @ 64,12 SAY subs(dtoc(DATE()),4,2)                                                                                                                                                                                                                  
      @ 64,15 SAY subs(dtoc(DATE()),7,4)                                                                                                                                                                                                                  
   CASE TOTALL>0 .AND. pilc=6                                                                                                                                                                                                                             
      @ 53,26  SAY "C R E D I T   V O U C H E R"                                                                                                                                                                                                          
      @ 55,10  say  RTRIM(FNMPAT)+' '+NMPAT+', Dependant of '+depper                                                                                                                                                                                      
      @ 56,58 SAY subs(dtoc(DATE()),1,2)                                                                                                                                                                                                                  
      @ 56,61 SAY subs(dtoc(DATE()),4,2)                                                                                                                                                                                                                  
      @ 56,64 SAY subs(dtoc(DATE()),7,4)                                                                                                                                                                                                                  
      @ 61,3  SAY "Send Invoice to : A. E. A. International Clinic    Tel : 750 6001        "                                                                                                                                                             
      @ 63,3  SAY "to the attention of : Personnel Department"                                                                                                                                                                                            
      @ 64,9 say subs(dtoc(date()),1,2)                                                                                                                                                                                                                   
      @ 64,12 SAY subs(dtoc(DATE()),4,2)                                                                                                                                                                                                                  
      @ 64,15 SAY subs(dtoc(DATE()),7,4)                                                                                                                                                                                                                  
   CASE TOTALL>0 .AND. PILC<>6 .and. pilc<>3 .and. pilc<>5                                                                                                                                                                                                
      @ 53,26  SAY "C R E D I T   V O U C H E R"                                                                                                                                                                                                          
      @ 55,10  say  RTRIM(FNMPAT)+' '+NMPAT                                                                                                                                                                                                               
      @ 56,58 SAY subs(dtoc(DATE()),1,2)                                                                                                                                                                                                                  
      @ 56,61 SAY subs(dtoc(DATE()),4,2)                                                                                                                                                                                                                  
      @ 56,64 SAY subs(dtoc(DATE()),7,4)                                                                                                                                                                                                                  
      DO CASE                                                                                                                                                                                                                                             
      CASE PILC=2                                                                                                                                                                                                                                         
         @ 57,3  say "Paid, the sum of : "+AEACURR                                                                                                                                                                                                        
         @ 57,25 say PARTCASH pict '99,999,999'                                                                                                                                                                                                           
         @ 57,37 say 'by : '+paymode                                                                                                                                                                                                                      
         @ 58,3  SAY "The balance payable to AEA Intl. Clinic for this treatment is:"+AEACURR+'           .'                                                                                                                                              
         @ 58,68 SAY PARTCRED PICT '99,999,999'                                                                                                                                                                                                           
      CASE PILC=4                                                                                                                                                                                                                                         
         @ 57,3  SAY "Your AEA-TMS Medical Plan renewal has not been processed, yet"                                                                                                                                                                      
         @ 58,3  SAY "The amount payable to AEA Intl. Clinic for this treatment is:"+AEACURR+'           .'                                                                                                                                               
         @ 58,67 SAY TOTALL PICT '99,999,999'                                                                                                                                                                                                             
      OTHER                                                                                                                                                                                                                                               
         IF AUTHOR<>SPACE(16)                                                                                                                                                                                                                             
            @ 57,3 SAY "CREDIT AUTHORIZED BY : "+AUTHOR PICT "@!"                                                                                                                                                                                         
         ENDIF                                                                                                                                                                                                                                            
         @ 58,3  SAY "The amount payable to AEA Intl. Clinic for this treatment is:"+AEACURR+'           .'                                                                                                                                               
         @ 58,67 SAY TOTALL PICT '99,999,999'                                                                                                                                                                                                             
      ENDCASE                                                                                                                                                                                                                                             
      @ 59,3  SAY "Invoice to : _____________________________________ Tel : ________________"                                                                                                                                                             
      @ 60,3  SAY "Company : _______________________________________________________________"                                                                                                                                                             
      @ 61,3  SAY "Address : _______________________________________________________________"                                                                                                                                                             
      @ 62,3  say "          ________________________________________ Tel : ________________"                                                                                                                                                             
      @ 63,3  SAY "to the attention of : ________________________(Name of Authorized Person)"                                                                                                                                                             
      @ 64,9 say subs(dtoc(date()),1,2)                                                                                                                                                                                                                   
      @ 64,12 SAY subs(dtoc(DATE()),4,2)                                                                                                                                                                                                                  
      @ 64,15 SAY subs(dtoc(DATE()),7,4)                                                                                                                                                                                                                  
   ENDCASE                                                                                                                                                                                                                                                
   EJECT                                                                                                                                                                                                                                                  
   SET DEVI TO SCREE                                                                                                                                                                                                                                      
   PREND=.T.                                                                                                                                                                                                                                              
